package com.rd.student.jike.class2.lihongming.Test;

import java.util.Deque;
import java.util.LinkedList;

/**
 * @Auther:Heinrich
 * @Date:2023/7/12-07-12-11:18
 * @Description:com.rd.student.jike.class2.lihongming
 * @version:1.0
 */
public class QueueExercise {
    public static void main(String[] args) {
        Student1 LiHongMing = new Student1("李宏鸣", "计科", "2班", "", 80);
        Student1 XueZhiXin = new Student1("薛志鑫", "计科", "2班", "", 66);
        Student1 WangHaiXin = new Student1("王海鑫", "计科", "4班", "", 21);
        Student1 XiaYinYin = new Student1("夏银银", "计科", "4班", "", 18);
        Student1 WangXiangYang = new Student1("王向阳", "计科", "5班", "", 18);
        Student1 WuJunHao = new Student1("吴俊豪", "计科", "5班", "", 19);
        Deque studentDeque = new LinkedList();

        studentDeque.offerFirst(WangHaiXin);
        studentDeque.offerFirst(XueZhiXin);
        studentDeque.offerFirst(LiHongMing);
        studentDeque.offerLast(XiaYinYin);
        studentDeque.offerLast(WangXiangYang);
        studentDeque.offerLast(WuJunHao);
        System.out.println(studentDeque);
        System.out.println("---------------------");
        for (int i = 0; i < 3; i++) {
            Object ofir = studentDeque.pollFirst();
            System.out.println(ofir);
        }
        System.out.println("---------------------");
        for (int i = 0; i < 3; i++) {
            Object olas = studentDeque.pollLast();
            System.out.println(olas);
        }
        System.out.println("---------------------");
        System.out.println(studentDeque);
    }


}
